package com.yyq.sos.pojo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name = "ss_sys_sequences")
public class SysSequences implements java.io.Serializable
{
	private static final long serialVersionUID = -5064552155363091300L;
	private String className;
	private String tableName;
	private Long currValue;
	private Long nextValue;
	private Long incrementValue;
	private Long minValue;
	private Long maxValue;
	
	@Column(name = "class_name", nullable = false)
	public String getClassName() {
		return className;
	}
	public void setClassName(String className) {
		this.className = className;
	}
	
	@Id
	@GeneratedValue(generator = "c-assigned") 
	@GenericGenerator(name = "c-assigned", strategy = "assigned")
	@Column(name = "table_name", nullable = false)
	public String getTableName() {
		return tableName;
	}
	public void setTableName(String tableName) {
		this.tableName = tableName;
	}
	
	@Column(name = "curr_value")
	public Long getCurrValue() {
		return currValue;
	}
	
	public void setCurrValue(Long currValue) {
		this.currValue = currValue;
	}
	@Column(name = "next_value")
	public Long getNextValue() {
		return nextValue;
	}
	public void setNextValue(Long nextValue) {
		this.nextValue = nextValue;
	}
	@Column(name = "incrementValue")
	public Long getIncrementValue() {
		return incrementValue;
	}
	public void setIncrementValue(Long incrementValue) {
		this.incrementValue = incrementValue;
	}
	@Column(name = "min_value")
	public Long getMinValue() {
		return minValue;
	}
	public void setMixValue(Long minValue) {
		this.minValue = minValue;
	}
	
	@Column(name = "max_value")
	public Long getMaxValue() {
		return maxValue;
	}
	public void setMaxValue(Long maxValue) {
		this.maxValue = maxValue;
	}
	public Object clone() throws CloneNotSupportedException {
		SysSequences vo = new SysSequences();
		vo.className = this.className;
		vo.currValue = new Long(this.currValue.intValue() +this.incrementValue.intValue());
		vo.incrementValue = this.incrementValue;
		vo.maxValue = this.maxValue;
		vo.minValue = this.minValue;
		vo.nextValue = this.nextValue;
		vo.tableName = this.tableName;
		return vo;
	}
	public void setMinValue(Long minValue) {
		this.minValue = minValue;
	}
	
}
